package thread;

public class SaleTickets extends Thread {
   private static int tickets=100;

    //int ticketsNum;
    int num;


    public void run(){
        while (tickets>0) {

            System.out.println("准备卖掉" + tickets + "张票");
            --tickets;
            num++;
        }
        System.out.println(num);
    }

    public static void main(String[] args) {
        SaleTickets a=new SaleTickets();
        SaleTickets b=new SaleTickets();
        SaleTickets c=new SaleTickets();

        a.start();
        b.start();
        c.start();

    }







}
